package lxt.action;


import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import lxt.action.core.ActionSupport;
import lxt.action.core.DateUtil;
import lxt.entity.BorrowTruckInfo;
import lxt.entity.ChargeRecord;
import lxt.entity.ClientInfo;
import lxt.entity.DriverInfo;
import lxt.entity.InvoiceInfo;
import lxt.entity.InvoiceOrder;
import lxt.entity.Parameter;
import lxt.entity.TruckInfo;
import lxt.entity.UserInfo;
import lxt.service.ChargeRecordService;
import lxt.service.ClientService;
import lxt.service.DriverService;
import lxt.service.InvoiceInfoService;
import lxt.service.InvoiceOrderService;
import lxt.service.ParameterService;
import lxt.service.TruckService;

public class InvoiceOrderAction extends ActionSupport {

	private static final long serialVersionUID = 1L;

	/**
	 * 定义成员变量,用于查询条件
	 */
	private String orderIdDate;
	private String clientNameS;
	private String clientNameR;
	
	private String orderId;
	private String Sname;
	private String Rname;
    private String cargoName;
    private String cargoNorm;
    private String unitPrice;
    private String cargoQuantity;
    private String unit;
    private String totalFee;
    private String chargeType;
    private String SCharge;
    private String RCharge;
    private String SClientName;
    private String SClientPhone;
    private String SAddress;
    private Date STime;
    private String RClientName;
    private String RClientPhone;
    private String RAddress;
    private Date RTime;
    private Date entryTime;
    private String username;
    private String chargeRecordIdS;
    private String chargeRecordIdR;
    
    private String SnextChargeDate; //发货方预付日期
    private String RnextChargeDate; //签收方预付日期
    private String SClientId; //发货方客户id
	private String RClientId; //签收方客户id
	private String deleteIds; //记录删除Id
    private String[] cellValue; //定义运输方案字段
    private String invosType;//运输方案是否展开字段 Y：展开
    private String totalTimesStr;//总运货量
    private String totalQualityStr;
    private String totalFeeStr;
    
    private List<Parameter> paramter;
	/**
	 * 定义分页成员变量
	 */
	private Integer pageSize = 10;
	private String currPage = "1";
	private Integer total;
	/**
	 * 定义Service接口
	 */
	private InvoiceOrderService invoiceOrderService;
	private ClientService clientService;
	private DriverService driverService;
	private TruckService truckService;
	private ChargeRecordService chargeRecordService;
	private InvoiceInfoService invoiceInfoService;
	private ParameterService parameterService;
	/**
	 * 返回结果集
	 */
	private List<InvoiceOrder> invoiceOrders;
	private List<TruckInfo> trucks;
	private List<DriverInfo> drivers;
	private List<Object> invoices;
	/**
	 * 分页查询订单列表
	 * @return
	 */
	public String loadAll(){
		try{
			//定义从第几条显示
			int offset = (Integer.parseInt(currPage) - 1) * pageSize;
			invoiceOrders = invoiceOrderService.loadByPage(orderIdDate, clientNameS,clientNameR, offset, pageSize);
			total = invoiceOrderService.loadOrderCount(orderIdDate, clientNameS,clientNameR);
		}catch(Exception ex){
			ex.printStackTrace();
			this.addActionMessage("操作失败，请检查重新操作.");
		}
			return SUCCESS;
	}
	/**
	 * 添加预处理
	 * @return
	 */
	public String addPre(){
		try{
			paramter = parameterService.loadByParamType("licenseType");
		}catch(Exception ex){
			ex.printStackTrace();
			this.addActionMessage("操作失败，请检查重新操作");
		}
		return SUCCESS;
	}
	/**
	 * 添加
	 * @return
	 */
	public String add(){
		try{
			InvoiceOrder invoiceOrder = new InvoiceOrder();
			/**
			 * (未考虑并发录入)
			 * 格式化订单ID的日期(改为连续数字字母，无‘-’字符，减少页面显示宽度)
			 */
			Date date = new Date();
		    SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
		    String dateStr = sdf.format(date);
		    /**
		     * 查询今天时间里现有的订单ID
		     */
			List<String> orderIdList = this.invoiceOrderService.queryOrderId(dateStr);
			/**
			 * 生成格式化的订单ID
			 */ 
			if(orderIdList!=null&&orderIdList.size()>0){
				String orderIdDate = orderIdList.get(orderIdList.size()-1);
				char cha = orderIdDate.charAt(orderIdDate.length()-1);
				char chb = (char) (cha + 1);
				this.orderId = dateStr + chb;
			}else{
				this.orderId = dateStr + "A";
			}
			invoiceOrder.setOrderId(orderId);
			/**
			 * 插入客户 根据客户id加载客户
			 */
			ClientInfo clientInfoBySClient = clientService.loadClientById(SClientId);
			if(clientInfoBySClient==null){
				this.addActionMessage("操作失败，请检查重新操作.");
				return INPUT;
			}
			invoiceOrder.setClientInfoBySClient(clientInfoBySClient);
			invoiceOrder.setSClientName(SClientName);//发件人
			invoiceOrder.setSClientPhone(SClientPhone); //联系电话
			invoiceOrder.setSAddress(SAddress); //单位地址
			
			ClientInfo clientInfoByRClient = clientService.loadClientById(RClientId);
			if(clientInfoByRClient==null){
				this.addActionMessage("操作失败，请检查重新操作.");
				return INPUT;
			}
			invoiceOrder.setClientInfoByRClient(clientInfoByRClient);
			invoiceOrder.setRClientName(RClientName);
			invoiceOrder.setRClientPhone(RClientPhone);
			invoiceOrder.setRAddress(RAddress);
			
			invoiceOrder.setCargoName(cargoName);
			invoiceOrder.setCargoNorm(cargoNorm);
			if(cargoQuantity!=null&&!cargoQuantity.equals("")){ //运货数量
				invoiceOrder.setCargoQuantity(Double.parseDouble(cargoQuantity));
			}
			invoiceOrder.setChargeType(Integer.parseInt(chargeType));
			if(SCharge!=null&&!SCharge.equals("")){
				invoiceOrder.setSCharge(Double.parseDouble(SCharge));
			}
			if(RCharge!=null&&!RCharge.equals("")){
				invoiceOrder.setRCharge(Double.parseDouble(RCharge));
			}
			if(totalFee!=null&&!totalFee.equals("")){
				invoiceOrder.setTotalFee(Double.parseDouble(totalFee));
			}
			invoiceOrder.setUnit(unit);//单位
			if(unitPrice!=null&&!unitPrice.equals("")){ //单价
				invoiceOrder.setUnitPrice(Double.parseDouble(unitPrice));
			}
			/**
			 * 获得登录user
			 */
			UserInfo user = (UserInfo)this.getSession().get("user"); 
			invoiceOrder.setUsername(user.getUsername());	
			/**
			 * 针对ChargeRecord表
			 * 存入应收运费,下次收费日期
			 */
			ChargeRecord chargRecordS =null ;
			ChargeRecord chargRecordR =null;
			if(chargeType.equals("0")){//双方付款
				chargRecordS = new ChargeRecord();
				chargRecordS.setClientInfo(clientInfoBySClient);
				chargRecordS.setInvoiceOrder(invoiceOrder);
				chargRecordS.setOweFee(Double.parseDouble(SCharge));
				chargRecordS.setRealPayFee(0);
				chargRecordS.setNextChargeDate(sdf.parse(SnextChargeDate));
				chargRecordS.setNextChargeFee(Double.parseDouble(SCharge)-0);
				chargRecordS.setUsername(user.getUsername());
				
				chargRecordR = new ChargeRecord();
				chargRecordR.setClientInfo(clientInfoByRClient);
				chargRecordR.setInvoiceOrder(invoiceOrder);
				chargRecordR.setOweFee(Double.parseDouble(RCharge));
				chargRecordR.setRealPayFee(0);
				chargRecordR.setNextChargeDate(sdf.parse(RnextChargeDate));
				chargRecordR.setNextChargeFee(Double.parseDouble(RCharge)-0);
				chargRecordR.setUsername(user.getUsername());
			}
			else if(chargeType.equals("1")){ //发货方付款
				chargRecordS = new ChargeRecord();
				chargRecordS.setClientInfo(clientInfoBySClient);
				chargRecordS.setInvoiceOrder(invoiceOrder);
				chargRecordS.setOweFee(Double.parseDouble(SCharge));
				chargRecordS.setRealPayFee(0);
				chargRecordS.setNextChargeDate(sdf.parse(SnextChargeDate));
				chargRecordS.setNextChargeFee(Double.parseDouble(SCharge)-0);
				chargRecordS.setUsername(user.getUsername());
			}
			else{//签收方付款
				chargRecordR = new ChargeRecord();
				chargRecordR.setClientInfo(clientInfoByRClient);
				chargRecordR.setInvoiceOrder(invoiceOrder);
				chargRecordR.setOweFee(Double.parseDouble(RCharge));
				chargRecordR.setRealPayFee(0);
				chargRecordR.setNextChargeDate(sdf.parse(RnextChargeDate));
				chargRecordR.setNextChargeFee(Double.parseDouble(SCharge)-0);
				chargRecordR.setUsername(user.getUsername());
			}
			/**
			 * 针对InvoiceInfo表
			 */
			ArrayList<InvoiceInfo> invoiceInfos = new ArrayList<InvoiceInfo>();
			ArrayList<BorrowTruckInfo> borrowTrucks = new ArrayList<BorrowTruckInfo>();
			ArrayList<String> driversName = new ArrayList<String>();
			if(cellValue!=null&&cellValue.length>0){
				for(int i=0;i<cellValue.length;i++){
					String strCell = cellValue[i];
					String[] strCells = strCell.split("@");
					InvoiceInfo invo = new InvoiceInfo();
					String truckIdCell = strCells[0];
					String driverNameCell = strCells[1];
					String loadPertimeCell = strCells[2];   //cargoQuantity
					String transTimesCell = strCells[3];
					
					invo.setInvoiceOrder(invoiceOrder);
					if(driverNameCell.equals("-")){
						invo.setIsBorrowed(1);
						/**
						 * 针对BorrowTruckInfo表
						 */
						BorrowTruckInfo btruck = new BorrowTruckInfo();
						//truckIdCell 借车id
						String b_ownerName = strCells[4];
						String b_unitFee = strCells[5];
						if(strCells[6]!=null&&!strCells[6].equals("")){
							String b_note = strCells[6];
							invo.setNote(b_note);
							btruck.setNote(b_note);
						}
						String b_entryTime = strCells[7].trim();
						btruck.setEntryTime(sdf.parse(b_entryTime));
						
						btruck.setTruckId(truckIdCell);
						btruck.setOwnerName(b_ownerName);
						btruck.setUnitFee(Double.parseDouble(b_unitFee));
						btruck.setCargoQuantity(Double.parseDouble(loadPertimeCell));
						btruck.setTotalCharge(Double.parseDouble(b_unitFee)*Double.parseDouble(loadPertimeCell));
						btruck.setIsPayed(0);
						borrowTrucks.add(btruck);
					}
					else{
						invo.setIsBorrowed(0);
					}
					invo.setLoadPertime(Double.parseDouble(loadPertimeCell));
					invo.setTransTimes(Integer.parseInt(transTimesCell));
					invo.setTruckId(truckIdCell);
				
					invoiceInfos.add(invo);
				}
				/**
				 * 针对DriverWorkload表
				 */
				for(int i=0;i<cellValue.length;i++){
					String strCell = cellValue[i];
					String[] strCells = strCell.split("@");
					
					String driverNameCell = strCells[1]; //获得驾驶员
					if(!driverNameCell.equals("-")){
						driversName.add(driverNameCell);
					}
				}
			}
			this.invoiceOrderService.addInvoiceOrder(invoiceOrder,invoiceInfos,chargRecordS,chargRecordR,driversName,borrowTrucks);
		}catch(Exception ex){
			ex.printStackTrace();
			this.addActionMessage("操作失败，请检查重新操作.");
		}
		return SUCCESS;
	}
	/**
	 * 删除
	 * @return
	 */
	public String delete(){
		try{
			/**
			 * 查看用户操作时间 设置编辑权限
			 */
			UserInfo user = (UserInfo) this.getSession().get("user");
			if(user.getLoginType()!=0){//记录员
				for(int i=0;i<deleteIds.length();i++){
					String[] delId = deleteIds.split(",");
					InvoiceOrder c = this.invoiceOrderService.loadInvoiceOrderById(delId[i]);
					int falg = DateUtil.getDays(c.getEntryTime());
					if(falg!=0){
						this.addActionMessage("无权修改数据,请联系管理员");
						this.loadAll();
						return INPUT;
					}
				}
			}
			this.invoiceOrderService.deleteInvoiceOrder(deleteIds);
		}catch(Exception ex){
			ex.printStackTrace();
			this.addActionMessage("操作失败，请检查重新操作");
		}
		return SUCCESS;
	}
	/**
	 * 编辑预处理
	 * @return
	 */
	public String updatePre(){
		try{
			paramter = parameterService.loadByParamType("licenseType");
			
			InvoiceOrder invoiceOrder = this.invoiceOrderService.loadInvoiceOrderById(this.orderId);
			/**
			 * 查看用户操作时间 设置编辑权限
			 */
			UserInfo user = (UserInfo) this.getSession().get("user");
			if(user.getLoginType()!=0){//记录员
				Date preTime = invoiceOrder.getEntryTime();
				int falg = DateUtil.getDays(preTime);
				if(falg!=0){
					this.addActionMessage("无权修改数据,请联系管理员");
					this.loadAll();
					return INPUT;
				}
			}
			/**
			 * 回填订单信息
			 */
			this.Sname = invoiceOrder.getClientInfoBySClient().getClientName();//单位名称
			this.Rname = invoiceOrder.getClientInfoByRClient().getClientName();
			this.SClientName = invoiceOrder.getSClientName(); //发件人
			this.RClientName = invoiceOrder.getRClientName();
			this.SClientPhone = invoiceOrder.getSClientPhone(); //联系电话
			this.RClientPhone = invoiceOrder.getRClientPhone();
			this.SAddress = invoiceOrder.getSAddress();//单位地址
			this.RAddress = invoiceOrder.getRAddress();
			this.cargoName = invoiceOrder.getCargoName();//货物名称
			this.cargoNorm = invoiceOrder.getCargoNorm();//货物规格
			this.cargoQuantity = String.valueOf(invoiceOrder.getCargoQuantity());//货物数量
			this.unit = invoiceOrder.getUnit(); //单位
			this.unitPrice = String.valueOf(invoiceOrder.getUnitPrice());//单价
			this.totalFee = String.valueOf(invoiceOrder.getTotalFee());
			
			this.chargeType = String.valueOf(invoiceOrder.getChargeType());//付款方式
			/**
			 * 回填付款方式 ChargeRecord表 
			 */
			String clientIdTemp;
			if(this.chargeType.equals("1")){//发货方
				this.SCharge = String.valueOf(invoiceOrder.getSCharge());//发货方预付金额
				clientIdTemp = invoiceOrder.getClientInfoBySClient().getClientId();
				ChargeRecord tempS = (ChargeRecord) this.chargeRecordService.queryByNextChargeDate(orderId, clientIdTemp);
				if(tempS!=null){
					this.chargeRecordIdS = tempS.getId();
					this.SnextChargeDate = String.valueOf(tempS.getNextChargeDate());
				}
			}
			else if(this.chargeType.equals("2")){
				this.RCharge = String.valueOf(invoiceOrder.getRCharge());
				clientIdTemp = invoiceOrder.getClientInfoByRClient().getClientId();
				ChargeRecord tempR = (ChargeRecord) this.chargeRecordService.queryByNextChargeDate(orderId, clientIdTemp);
				if(tempR!=null){
					this.chargeRecordIdR = tempR.getId();
					this.SnextChargeDate = String.valueOf(tempR.getNextChargeDate());
				}
			}
			else{
				this.SCharge = String.valueOf(invoiceOrder.getSCharge());
				this.RCharge = String.valueOf(invoiceOrder.getRCharge());
				clientIdTemp = invoiceOrder.getClientInfoBySClient().getClientId();
				ChargeRecord tempS = (ChargeRecord) this.chargeRecordService.queryByNextChargeDate(orderId, clientIdTemp);
				if(tempS!=null){
					this.chargeRecordIdS = tempS.getId();
					this.SnextChargeDate = String.valueOf(tempS.getNextChargeDate());
				}
				clientIdTemp = invoiceOrder.getClientInfoByRClient().getClientId();
				ChargeRecord tempR = (ChargeRecord) this.chargeRecordService.queryByNextChargeDate(orderId, clientIdTemp);
				if(tempR!=null){
					this.chargeRecordIdR = tempR.getId();
					this.RnextChargeDate = String.valueOf(tempR.getNextChargeDate());
				}
			}
			/**
			 * 回填运输方案
			 */
			invoices = this.invoiceInfoService.queryInvoiceInfoById(this.orderId) ;
			
			if(invoices.size()>0){
				this.invosType = "Y";//判断是否存在运输方案
				/**
				 * 页面合计行显示信息
				 */
				Double douQ = 0.0;
				Double douF = 0.0;
				Integer douT = 0;
				for(int i=0;i<invoices.size();i++){
					 Object[] o = (Object[]) invoices.get(i);
					 douT += (Integer) o[6];
					 douQ += (Double) o[4] * (Integer) o[6];
					 douF += (Double) o[4] * (Integer) o[6] * (Double)o[5];
				}
				this.totalQualityStr =String.valueOf(douQ);
				this.totalFeeStr=String.valueOf(douF);
				this.totalTimesStr = String.valueOf(douT);
			}
		}catch(Exception ex){
			ex.printStackTrace();
			this.addActionMessage("操作失败，请检查重新操作");
			this.loadAll();
			return INPUT;
		}
		return SUCCESS;
	}
	
	/**
	 * 修改
	 * @return
	 */
	public String update(){
		try{
			/**
			 * 根据订单id加载信息
			 */
			InvoiceOrder invoiceOrder = this.invoiceOrderService.loadInvoiceOrderById(this.orderId);
			/**
			 * 设置订单修改信息
			 */
			invoiceOrder.setSClientName(SClientName);//发件人
			invoiceOrder.setRClientName(RClientName);
			invoiceOrder.setSClientPhone(SClientPhone); //联系电话
			invoiceOrder.setRClientPhone(RClientPhone);
			invoiceOrder.setSAddress(SAddress); //单位地址
			invoiceOrder.setRAddress(RAddress);
			invoiceOrder.setCargoName(cargoName);//货物名称
			invoiceOrder.setCargoNorm(cargoNorm);//货物规格
			invoiceOrder.setCargoQuantity(Double.parseDouble(cargoQuantity)); //货物数量
			invoiceOrder.setUnit(unit);//单位
			invoiceOrder.setUnitPrice(Double.parseDouble(unitPrice));//单价
			invoiceOrder.setChargeType(Integer.parseInt(chargeType));//付款方式
			/**
			 * 获得登录user
			 */
			UserInfo user = (UserInfo)this.getSession().get("user"); 
			invoiceOrder.setUsername(user.getUsername());	
			/**
			 * 针对ChargeRecord表
			 * 修改应收运费,下次收费日期
			 */
			ChargeRecord chargeRecordS = null;
			ChargeRecord chargeRecordR = null;
			SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
			if(chargeType.equals("0")){//双方付款
				chargeRecordS = this.chargeRecordService.loadChargeById(this.chargeRecordIdS);
				chargeRecordS.setOweFee(Double.parseDouble(SCharge));
				chargeRecordS.setNextChargeDate(sdf.parse(SnextChargeDate));
				chargeRecordS.setNextChargeFee(Double.parseDouble(SCharge)-0);
				chargeRecordS.setUsername(user.getUsername());
				
				chargeRecordR = this.chargeRecordService.loadChargeById(this.chargeRecordIdR);
				chargeRecordR.setOweFee(Double.parseDouble(RCharge));
				chargeRecordR.setNextChargeDate(sdf.parse(RnextChargeDate));
				chargeRecordR.setNextChargeFee(Double.parseDouble(RCharge)-0);
				chargeRecordR.setUsername(user.getUsername());
			}
			else if(chargeType.equals("1")){ //发货方付款
				chargeRecordS = this.chargeRecordService.loadChargeById(this.chargeRecordIdS);
				chargeRecordS.setOweFee(Double.parseDouble(SCharge));
				chargeRecordS.setNextChargeDate(sdf.parse(SnextChargeDate));
				chargeRecordS.setNextChargeFee(Double.parseDouble(SCharge)-0);
				chargeRecordS.setUsername(user.getUsername());
			}
			else{//签收方付款
				chargeRecordR = this.chargeRecordService.loadChargeById(this.chargeRecordIdR);
				chargeRecordR.setOweFee(Double.parseDouble(RCharge));
				chargeRecordR.setNextChargeDate(sdf.parse(RnextChargeDate));
				chargeRecordR.setNextChargeFee(Double.parseDouble(RCharge)-0);
				chargeRecordR.setUsername(user.getUsername());
			}
			/**
			 * 针对InvoiceInfo表
			 */
			ArrayList<InvoiceInfo> invoiceInfos = new ArrayList<InvoiceInfo>();
			ArrayList<BorrowTruckInfo> borrowTrucks = new ArrayList<BorrowTruckInfo>();
			ArrayList<String> driversName = new ArrayList<String>();
			if(cellValue!=null&&cellValue.length>0){
				for(int i=0;i<cellValue.length;i++){
					String strCell = cellValue[i];
					String[] strCells = strCell.split("@");
					InvoiceInfo invo = new InvoiceInfo();
					String truckIdCell = strCells[0];
					String driverNameCell = strCells[1];
					String loadPertimeCell = strCells[2];   //cargoQuantity
					String transTimesCell = strCells[3];
					
					invo.setInvoiceOrder(invoiceOrder);
					if(driverNameCell.equals("-")){
						invo.setIsBorrowed(1);
						/**
						 * 针对BorrowTruckInfo表
						 */
						BorrowTruckInfo btruck = new BorrowTruckInfo();
						//truckIdCell 借车id
						String b_ownerName = strCells[4];
						String b_unitFee = strCells[5];
						if(strCells[6]!=null&&!strCells[6].equals("")){
							String b_note = strCells[6];
							invo.setNote(b_note);
							btruck.setNote(b_note);
						}
						String b_entryTime = strCells[7].trim();
						btruck.setEntryTime(sdf.parse(b_entryTime));
						btruck.setTruckId(truckIdCell);
						btruck.setOwnerName(b_ownerName);
						btruck.setUnitFee(Double.parseDouble(b_unitFee));
						btruck.setCargoQuantity(Double.parseDouble(loadPertimeCell));
						btruck.setTotalCharge(Double.parseDouble(b_unitFee)*Double.parseDouble(loadPertimeCell));
						btruck.setIsPayed(0);
						borrowTrucks.add(btruck);
					}
					else{
						invo.setIsBorrowed(0);
					}
					invo.setLoadPertime(Double.parseDouble(loadPertimeCell));
					invo.setTransTimes(Integer.parseInt(transTimesCell));
					invo.setTruckId(truckIdCell);
					invoiceInfos.add(invo);
				}
				/**
				 * 针对DriverWorkload表
				 */
				for(int i=0;i<cellValue.length;i++){
					String strCell = cellValue[i];
					String[] strCells = strCell.split("@");
					
					String driverNameCell = strCells[1]; //获得驾驶员
					if(!driverNameCell.equals("-")){
						driversName.add(driverNameCell);
					}
				}
			}
			this.invoiceOrderService.updateInvoiceOrder(invoiceOrder,null,invoiceInfos,chargeRecordS,chargeRecordR,driversName,borrowTrucks);
		}catch(Exception ex){
			ex.printStackTrace();
			this.addActionMessage("操作失败，请检查重新操作.");
		}
		return SUCCESS;
	}
	/**
	 * 处理弹出选择车辆页面
	 * @return
	 */
	@SuppressWarnings("finally")
	public String loadPopup(){
		try{
			drivers = driverService.loadAll();
			trucks = truckService.loadAll();
		}catch(Exception e){
			e.printStackTrace();
			this.addActionMessage("读取数据错误.");
		}finally{
			return SUCCESS;
		}
	}
	/**
	 * get set 
	 * @return
	 */

	public void setInvoiceOrderService(InvoiceOrderService invoiceOrderService) {
		this.invoiceOrderService = invoiceOrderService;
	}
	public String getCurrPage() {
		return currPage;
	}
	public void setCurrPage(String currPage) {
		this.currPage = currPage;
	}
	public Integer getTotal() {
		return total;
	}
	public void setTotal(Integer total) {
		this.total = total;
	}
	public List<InvoiceOrder> getInvoiceOrders() {
		return invoiceOrders;
	}
	public void setInvoiceOrders(List<InvoiceOrder> invoiceOrders) {
		this.invoiceOrders = invoiceOrders;
	}
	public String getOrderId() {
		return orderId;
	}
	public void setOrderId(String orderId) {
		System.out.println(orderId);
		this.orderId = orderId;
	}
	public String getSname() {
		return Sname;
	}
	public void setSname(String sname) {
		Sname = sname;
	}
	public String getRname() {
		return Rname;
	}
	public void setRname(String rname) {
		Rname = rname;
	}
	public String getCargoName() {
		return cargoName;
	}
	public void setCargoName(String cargoName) {
		this.cargoName = cargoName;
	}
	public String getCargoNorm() {
		return cargoNorm;
	}
	public void setCargoNorm(String cargoNorm) {
		this.cargoNorm = cargoNorm;
	}
	public String getUnitPrice() {
		return unitPrice;
	}
	public void setUnitPrice(String unitPrice) {
		this.unitPrice = unitPrice;
	}
	public String getCargoQuantity() {
		return cargoQuantity;
	}
	public void setCargoQuantity(String cargoQuantity) {
		this.cargoQuantity = cargoQuantity;
	}
	public String getUnit() {
		return unit;
	}
	public void setUnit(String unit) {
		this.unit = unit;
	}
	public String getTotalFee() {
		return totalFee;
	}
	public void setTotalFee(String totalFee) {
		this.totalFee = totalFee;
	}
	public String getChargeType() {
		return chargeType;
	}
	public void setChargeType(String chargeType) {
		this.chargeType = chargeType;
	}
	public String getSCharge() {
		return SCharge;
	}
	public void setSCharge(String charge) {
		SCharge = charge;
	}
	public String getRCharge() {
		return RCharge;
	}
	public void setRCharge(String charge) {
		RCharge = charge;
	}
	public String getSClientName() {
		return SClientName;
	}
	public void setSClientName(String clientName) {
		SClientName = clientName;
	}
	public String getSClientPhone() {
		return SClientPhone;
	}
	public void setSClientPhone(String clientPhone) {
		SClientPhone = clientPhone;
	}
	public String getSAddress() {
		return SAddress;
	}
	public void setSAddress(String address) {
		SAddress = address;
	}
	public Date getSTime() {
		return STime;
	}
	public void setSTime(Date time) {
		STime = time;
	}
	public String getRClientName() {
		return RClientName;
	}
	public void setRClientName(String clientName) {
		RClientName = clientName;
	}
	public String getRClientPhone() {
		return RClientPhone;
	}
	public void setRClientPhone(String clientPhone) {
		RClientPhone = clientPhone;
	}
	public String getRAddress() {
		return RAddress;
	}
	public void setRAddress(String address) {
		RAddress = address;
	}
	public Date getRTime() {
		return RTime;
	}
	public void setRTime(Date time) {
		RTime = time;
	}
	public Date getEntryTime() {
		return entryTime;
	}
	public void setEntryTime(Date entryTime) {
		this.entryTime = entryTime;
	}
	public String getUsername() {
		return username;
	}
	public void setUsername(String username) {
		this.username = username;
	}
	public Integer getPageSize() {
		return pageSize;
	}
	public void setPageSize(Integer pageSize) {
		this.pageSize = pageSize;
	}
	public InvoiceOrderService getInvoiceOrderService() {
		return invoiceOrderService;
	}
	public ClientService getClientService() {
		return clientService;
	}
	public void setClientService(ClientService clientService) {
		this.clientService = clientService;
	}
	public String getOrderIdDate() {
		return orderIdDate;
	}
	public void setOrderIdDate(String orderIdDate) {
		this.orderIdDate = orderIdDate;
	}
	public String getClientNameS() {
		return clientNameS;
	}
	public void setClientNameS(String clientNameS) {
		this.clientNameS = clientNameS;
	}
	public String getClientNameR() {
		return clientNameR;
	}
	public void setClientNameR(String clientNameR) {
		this.clientNameR = clientNameR;
	}
	public String getSnextChargeDate() {
		return SnextChargeDate;
	}
	public void setSnextChargeDate(String snextChargeDate) {
		SnextChargeDate = snextChargeDate;
	}
	public String getRnextChargeDate() {
		return RnextChargeDate;
	}
	public void setRnextChargeDate(String rnextChargeDate) {
		RnextChargeDate = rnextChargeDate;
	}
	public String getSClientId() {
		return SClientId;
	}
	public void setSClientId(String clientId) {
		SClientId = clientId;
	}
	public ChargeRecordService getChargeRecordService() {
		return chargeRecordService;
	}
	public void setChargeRecordService(ChargeRecordService chargeRecordService) {
		this.chargeRecordService = chargeRecordService;
	}
	public String getRClientId() {
		return RClientId;
	}
	public void setRClientId(String clientId) {
		RClientId = clientId;
	}
	public String getDeleteIds() {
		return deleteIds;
	}
	public void setDeleteIds(String deleteIds) {
		this.deleteIds = deleteIds;
	}
	public List<TruckInfo> getTrucks() {
		return trucks;
	}
	public List<DriverInfo> getDrivers() {
		return drivers;
	}
	public void setDriverService(DriverService driverService) {
		this.driverService = driverService;
	}
	public void setTruckService(TruckService truckService) {
		this.truckService = truckService;
	}
	public DriverService getDriverService() {
		return driverService;
	}
	public TruckService getTruckService() {
		return truckService;
	}
	public void setTrucks(List<TruckInfo> trucks) {
		this.trucks = trucks;
	}
	public void setDrivers(List<DriverInfo> drivers) {
		this.drivers = drivers;
	}
	public String[] getCellValue() {
		return cellValue;
	}
	public void setCellValue(String[] cellValue) {
		this.cellValue = cellValue;
	}
	public InvoiceInfoService getInvoiceInfoService() {
		return invoiceInfoService;
	}
	public void setInvoiceInfoService(InvoiceInfoService invoiceInfoService) {
		this.invoiceInfoService = invoiceInfoService;
	}
	public List<Object> getInvoices() {
		return invoices;
	}
	public void setInvoices(List<Object> invoices) {
		this.invoices = invoices;
	}
	public String getInvosType() {
		return invosType;
	}
	public void setInvosType(String invosType) {
		this.invosType = invosType;
	}
	public String getTotalTimesStr() {
		return totalTimesStr;
	}
	public String getTotalQualityStr() {
		return totalQualityStr;
	}
	public String getTotalFeeStr() {
		return totalFeeStr;
	}
	public void setTotalTimesStr(String totalTimesStr) {
		this.totalTimesStr = totalTimesStr;
	}
	public void setTotalQualityStr(String totalQualityStr) {
		this.totalQualityStr = totalQualityStr;
	}
	public void setTotalFeeStr(String totalFeeStr) {
		this.totalFeeStr = totalFeeStr;
	}
	public String getChargeRecordIdS() {
		return chargeRecordIdS;
	}
	public void setChargeRecordIdS(String chargeRecordIdS) {
		this.chargeRecordIdS = chargeRecordIdS;
	}
	public String getChargeRecordIdR() {
		return chargeRecordIdR;
	}
	public void setChargeRecordIdR(String chargeRecordIdR) {
		this.chargeRecordIdR = chargeRecordIdR;
	}
	public List<Parameter> getParamter() {
		return paramter;
	}
	public void setParameterService(ParameterService parameterService) {
		this.parameterService = parameterService;
	}
	
}
